import { request } from "@umijs/max";
import { stringify } from "qs";
//客房列表
export const getOrderRoomPage = (params:any) =>{
  const obj = {
    size:params.size,
    current:params.current,
    checkInTime:params.time[0].valueOf(),
    checkOutTime:params.time[1].valueOf(),
  }
  if(params.roomType) obj.roomType =params.roomType
  return request(`/room/page?${stringify(obj)}`, {
    method: "GET",
  });
}
//可预定列表
export const getRoomPage = (params:any) =>
  request(`/room/page?${stringify(params)}`, {
    method: "GET",
  });
  
//新增客房
export const addRoom = (params:any) =>
  request(`/room/save`, {
    method: "POST",
    data: params,
  });
//修改客房
export const editRoom = (params: any) =>
  request(`/room/edit`, {
    method: "POST",
    data: params,
  });
//查看客房详情
export const getRoomDetail = (roomId: number) =>
  request(`/room/query?roomId=${roomId}`, {
    method: "GET",
  });
//删除客房
export const delRoom = (roomIdArr: number[]) =>
  request(`/room/del`, {
    method: "POST",
    data: { items: roomIdArr },
  });


//查询客房列表
export const getRoomList = (floorId:number) =>request(`/room/queryList?floorId=${floorId}`,{
  method:'GET',
})

